<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="common.page.PageList"%>
<%
PageList pl=(PageList)request.getAttribute("pagelist");
int currentPage=pl.getStartPage();
int countPage=pl.getPageCount();
%>
<div class="pg">    	
  		<span>
  			<span style="float:left;padding-left:10px;"><a href="javascript:void(0);">总共&nbsp;&nbsp;<%=pl.getItemCount()%>&nbsp;&nbsp;条记录</a></span>
	  		<span style="float:right;padding-right:10px;">	  		
	 		<a href="javascript:void(0);" onclick="page('1');return false;">首页</a>&nbsp;&nbsp;
	 		<%
	 			int endItem=currentPage-5 > 0 ? currentPage - 5 : 1; 
	 			for(int i=endItem;i<=currentPage;i++){
	 				if(i != currentPage){
	 		%>
	  			<a href="javascript:void(0);" onclick="page('<%=i%>');return false;"><%=i%></a>&nbsp;&nbsp;
	  			<%}else{ %>
	  			<%=i%>&nbsp;&nbsp;  			
	  		<%} }%>
	  		<%
	  			endItem=currentPage+5 >= countPage ? countPage : currentPage+5;  			
	  			for(int i=currentPage;i<=endItem;i++){
	  			if(i != currentPage){
	  		%>
	 			<a href="javascript:void(0);" onclick="page('<%=i%>');return false;"><%=i%></a>&nbsp;&nbsp;  		
	  		<%}} %>
	 		<a href="javascript:void(0);" onclick="page('<%=countPage%>');return false;">尾页</a>&nbsp;&nbsp;
	 		<a href="javascript:void(0);"><%=pl.getStartPage()%>&nbsp;/&nbsp;<%=pl.getPageCount()%>&nbsp;页</a>
 		</span>
 	</span>    	
</div>
<script type="text/javascript">
function page(currentPage){
	$('#startPage').val(currentPage);
	document.forms[0].submit();
}
</script>